#include "ItemFactory.h"
#include "Item.h"
#include "ItemReference.h"
#include "ItemGroup.h"
#include "CampaignItem.h"
#include "CharacterItem.h"


AbstractItem* ItemFactory::create(const QString& className, QObject* parent)
{
    if (className == "CampaignItem") return new CampaignItem(parent);
    if (className == "CharacterItem") return new CharacterItem(parent);
    if (className == "ItemGroup") return new ItemGroup(parent);
    if (className == "Item") return new Item(dynamic_cast<AbstractItem*>(parent));
    if (className == "ItemReference") return new ItemReference(dynamic_cast<AbstractItem*>(parent));

    return 0;
}
